<?php if(isset($breadcrumb)) { ?>
<div class="breadcrumb">
    <?php foreach($breadcrumb as $item) { ?>
    <a href="<?php echo $item['href']; ?>"><?php echo $item['text']; ?></a>
    <?php if($item['last'] == false) { ?>
    ::
    <?php } ?>
    <?php } ?>
</div>
<? } ?>
<?if(isset($message)) { ?>
<div class="success"><?=$message?></div>
<? } ?>
<div class="box">
<div class="heading">
    <h1><img src="<?=base_url()?>images/admin/category.png" alt=""><?=$title?></h1>

    <div class="buttons">
        <? foreach($actions as $item) { ?>
        <? if($item['view_change_method'] == 'redirect') { ?>
        <a onclick="location.href = '<?=$item['href']?>'" class="button"><?=$item['text']?></a>
        <? } else { ?>
        <a onclick="$('#form').attr('action','<?=$item['href']?>');$('#form').submit();" class="button"><?=$item['text']?></a>
        <? } ?>
        <? } ?>
    </div>
</div>
<div class="content">
<form action="/admin/index.php?route=catalog/category/delete&amp;token=b42b963865ec58235020563ba79c4b73" method="post" enctype="multipart/form-data" id="form">
<table class="list">
<thead>
<tr>
    <td width="1" style="text-align: center;"><input type="checkbox" onclick="$('input[name*=\'selected\']').attr('checked', this.checked);">
    </td>
    <? foreach($headers as $item) { ?>
    <td class="left"><?=$item?></td>
    <? } ?>
</tr>
</thead>
<tbody>
<?php foreach($list as $item) { ?>
<tr>
    <?foreach($item as $name => $value) { ?>
    <td class="left">
        <? if($name == 'actions') { ?>

            <?php foreach($value as $a) { ?>
            [ <a href="<?php echo $a['href']; ?>" button_type="<?php echo isset($a['type']) ? $a['type'] : ''?>"><?php echo $a['text']; ?></a> ]
            <?php } ?>

        <? } else if($name == 'can_delete') { ?>
        <input type="checkbox" name="selected[]" value="<?php echo $value; ?>">
        <? } else { ?>
        <?php echo $value; ?>
        <? } ?>
    </td>
    <?php } ?>
</tr>
<?php } ?>
</tbody>
</table>
</form>
</div>
</div>